<?php
use Zend\Mvc\Router\Http\Query;

return array(
    'controllers' => array(
        'invokables' => array(
            'User\Controller\Auth' => 'User\Controller\AuthController',
        	'User\Controller\Index' => 'User\Controller\IndexController',
        	'User\Controller\Role' => 'User\Controller\RoleController',
        	'User\Controller\UserInRole' => 'User\Controller\UserInRoleController',
        ),
    ),
    'router' => array(
        'routes' => array(

            'user' => array(
                'type'    => 'Literal',
                'options' => array(
                    // Change this to something specific to your module
                    'route'    => '/user',
                    'defaults' => array(
                        // Change this value to reflect the namespace in which
                        // the controllers for your module are found
                        '__NAMESPACE__' => 'User\Controller',
                        'controller'    => 'index',
                        'action'        => 'index',
                    ),
                ),
                'may_terminate' => true,
                'child_routes' => array(
            		
                    'process' => array(
                        'type'    => 'Segment',
                        'options' => array(
                            'route'    => '/[:controller[/:action[/:page]]]',
                            'constraints' => array(
                                'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
                                'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
                            ),
                            'defaults' => array(
                            	'controller'    => 'index',
                            ),
                        ),

                    ),
                		
                		
                ),
            ),
        		
            
        ),
    ),
    'view_manager' => array(
        'template_path_stack' => array(
            'User' => __DIR__ . '/../view',
        ),
        
         'strategies' => array(
            'ViewJsonStrategy',
        ),
    ),

    'view_helpers' => array(
                    'factories' => array(
                                    'request_helper' => function($sm){
                                    $helper = new \Application\View\Helper\RequestHelper;
                                    $request = $sm->getServiceLocator()->get('Request');
                                    $helper->setRequest($request);
                                    return $helper;
                    },

            ),
    ),
);
